home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / tex-k / tex-k-archive.past / tex-k-archive.gz / tex-k-archive / 000398_interran@uluru.Stanford.EDU_Tue Mar 15 07:42:36 1994.msg < prev    next >
Internet Message Format  |  1994-10-11  |  3KB

  1. Received: from uluru.Stanford.EDU by cs.umb.edu with SMTP id AA24794
  2.   (5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Tue, 15 Mar 1994 18:39:50 -0500
  3. Received: by uluru.Stanford.EDU (4.1/inc-1.0)
  4.     id AA27018; Tue, 15 Mar 94 15:42:36 PST
  5. Date: Tue, 15 Mar 94 15:42:36 PST
  6. From: interran@uluru.Stanford.EDU (John Interrante)
  7. Message-Id: <9403152342.AA27018@uluru.Stanford.EDU>
  8. To: tex-k@cs.umb.edu
  9. Subject: xdvik-1.7 (dvi_init.c): fontp->file never initialized to NULL
  10.  
  11. After I installed dvipsk-5.528a, web2c-6.1, xdvik-1.7, and the new
  12. default /usr/local/texmf hierarchy from lib.tar.gz, I reinstalled a
  13. few additional LaTeX files (doc, nfss, psnfss, pstricks, and seminar).
  14. I wanted to check that dvips and xdvi worked with PostScript fonts as
  15. they used to, so I ran latex, dvips, and xdvi on PSNFSS 2.4.1's
  16. testps.tex.  latex and dvips worked fine, but xdvi crashed when I
  17. tried to preview testps.dvi:
  18.  
  19. Program received signal SIGSEGV, Segmentation fault.
  20. 0xf75b36b4 in fclose ()
  21. (gdb) bt 3
  22. #0  0xf75b36b4 in fclose ()
  23. #1  0x15754 in close_a_file () at util.c:134
  24. #2  0x15810 in xdvi_xfopen (
  25.     filename=0x103d58 "/usr/local/lib/texmf/fonts/public/cm/pk/cmsy10.432pk")
  26.     at util.c:158
  27. (gdb) up
  28. #1  0x15754 in close_a_file () at util.c:134
  29. (gdb) p f
  30. $1 = (struct font *) 0x531d8
  31. (gdb) p *f
  32. $2 = {
  33.   next = 0x52900, 
  34.   fontname = 0x59730 "rpncb", 
  35.   fsize = 300, 
  36.   magstepval = 0, 
  37.   file = 0x706e6362,        <--- this is what was passed to fclose
  38.   filename = 0x2e766600 "",    
  39.   timestamp = 0, 
  40.   flags = 1 '\001', 
  41.   maxchar = 0 '\000', 
  42.   dimconv = 2.5944375259443753, 
  43.   set_char_p = 0xd364 <load_n_set_char>, 
  44.   read_char = 0, 
  45.   glyph = 0x0, 
  46.   vf_chain = 0x0, 
  47.   first_font = 0x0, 
  48.   macro = 0x0
  49. }
  50.  
  51. What happened was xdvi allocated a struct font for rpncb, but opened a
  52. different font instead (pncb.vf) so it never initialized f->file or
  53. f->filename to anything.  Then much later on xdvi ran out of open
  54. files and had to close a file, so it looked for a non-NULL f->file
  55. with the smallest timestamp and ended up trying to close a garbage
  56. FILE* pointer.  
  57.  
  58. I found the place where xdvi originally allocated the struct font and
  59. made the change below.
  60.  
  61. *** xdvik/dvi_init.c.save    Fri Feb 25 05:51:53 1994
  62. --- xdvik/dvi_init.c    Tue Mar 15 13:59:15 1994
  63. ***************
  64. *** 376,381 ****
  65. --- 376,383 ----
  66.               "font structure");
  67.           fontp->fontname = fontname;
  68.           fontp->fsize = fsize;
  69. +         fontp->file = NULL;
  70. +         fontp->filename = NULL;
  71.           fontp->flags = FONT_IN_USE;
  72.           fontp->dimconv = scale * scale_dimconv / (1<<20);
  73.           fontp->set_char_p = load_n_set_char;
  74.  
  75. Now that fontp->file and fontp->filename are set to NULL, xdvi works
  76. fine although it has to fall back on a too-small font for some of the
  77. text that it's supposed to display.  That's OK, I can use ghostview or
  78. get gsftopk and make additional pk files to supplement the pk files in
  79. psfonts.tar.gz.
  80.  
  81.         John